<template>
	<view class="page-wrap" :data-theme="theme" :class="theme" :style="globalColor.style">
		<!-- 兼容之前的跳转（pages/card/detail）路径名片详情，跳转至分包的（pagesCard/card/detail）（pagesCard/enterprise/detail） -->
	</view>
</template>

<script>
export default {
	data() {
		return {
			theme: getApp().globalData.appTheme,
			globalColor: getApp().globalData.globalColor,
		};
	},
	onLoad(option) {
		// 扫码中转页
		console.log('detail', option)
		this.goPage(option)
	},
	methods: {
		goPage(option){
			// 扫码进入页面传递参数
			var scene = decodeURIComponent(option.scene);
			var obj = {isBack: 1};
			for (var i = 0; i < scene.split('*').length;i++){
			  var arr = scene.split('*')[i].split('/');
			  obj[arr[0]] = arr[1];
			}
			// 关闭当前页，跳转到分包之后的路径 obj太阳码路径传递的参数
			if(obj.p == 0){
				const data = obj
				// 个人名片
				this.$pageTo('/CardDetail',data, 'redirectTo')
			}else if(obj.p == 1){
				const data = obj
				// 企业名片
				this.$pageTo('/businessCard',data, 'redirectTo')
			}else{
				const data = option.scene ? scene : option;
					data.isBack = 1
				console.log('scene：',scene,'data：',data, 'option：',option)
				// 个人名片
				this.$pageTo('/CardDetail',data, 'redirectTo')
			}
			
		}
	}
};
</script>

<style scoped lang="scss">
</style>
